package sceneGraph;

import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;

/**
 * 
 * Node qui sert à dessiner un petit environnement en lignes simples.
 */
public class SceneOutlineNode extends SceneNode {

	private float minX = 200;
	private float minY = -150;
	private float minZ = -1100;
	
	private float maxX = -minX;
	private float maxY = 200;
	private float maxZ = -100;
	
	@Override
	public void draw(GLAutoDrawable gLDrawable) {
		if (gl != null) {
			gl.glBegin(GL.GL_LINE_LOOP);
			gl.glVertex3f(minX, minY, minZ);
			gl.glVertex3f(maxX, minY, minZ);
			gl.glVertex3f(maxX, maxY, minZ);
			gl.glVertex3f(minX, maxY, minZ);
			gl.glEnd();
			
			gl.glBegin(GL.GL_LINE_LOOP);
			gl.glVertex3f(minX, minY, maxZ);
			gl.glVertex3f(maxX, minY, maxZ);
			gl.glVertex3f(maxX, maxY, maxZ);
			gl.glVertex3f(minX, maxY, maxZ);
			gl.glEnd();

			gl.glBegin(GL.GL_LINES);
			gl.glVertex3f(minX, minY, minZ);
			gl.glVertex3f(minX, minY, maxZ);
			
			gl.glVertex3f(maxX, minY, minZ);
			gl.glVertex3f(maxX, minY, maxZ);
			
			gl.glVertex3f(maxX, maxY, minZ);
			gl.glVertex3f(maxX, maxY, maxZ);
			
			gl.glVertex3f(minX, maxY, minZ);
			gl.glVertex3f(minX, maxY, maxZ);
			gl.glEnd();
		}
	}

}
